<%-- 
    Document   : search
    Created on : Feb 15, 2012, 3:44:46 PM
    Author     : lab
--%>

<%@page import="dto.User"%>
<%@page import="java.util.ArrayList"%>
<%@page import="dao.UserDAO"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<%
    UserDAO daoUserDAO = new UserDAO();
    String name = request.getParameter("search");
    if (name.equals("")) {
        out.println("");
        return;
    }
    ArrayList<dto.User> list = daoUserDAO.getUsersByName(1, 10, name);
    out.println("<userlist>");
    for (User user : list) {
        
        out.println("<user>");
        out.println("<name>");
        out.println(user.getFirstName() + " " + user.getLastName());
        out.println("</name>");
        out.println("<email>");
        out.println(user.getEmail());
        out.println("</email>");
        out.println("</user>");
      
    }
      out.println("</userlist>");
%>